<?php

/**
 * 首页
 * User: tsang
 * Date: 2017/9/14
 * Time: 20:11
 */

namespace app\admin\controller;
use Doctrine\Common\Cache\MemcacheCache;
use think\Session;
use think\cache\driver\Redis;
class Wechat extends Common
{
    /*
    *	构造函数
    */
    function __construct(){
        parent::__construct();
    }

    /*
    *微信设置
    */
    public function set(){
        $wechat = db('wechat')->where(['id'=>'1'])->find();

        if(request()->isAjax()) {
            $we_chat_appid = input('we_chat_appid');
            $we_chat_appkey = input('we_chat_appkey');
            $we_chat_back_url = input('we_chat_back_url');

            db('wechat')->where(['id'=>'1'])->update(['we_chat_appid'=>$we_chat_appid,'we_chat_secret'=>$we_chat_appkey,'we_chat_back_url'=>$we_chat_back_url]);
            $this->success('保存成功!');
        }

        $this->assign('wechat',$wechat);
        return $this->fetch();
    }

   

}